#! /bin/bash

java -classpath ../../lib\;.. RTreeLoad data tree 20 10NN
java -classpath ../../lib\;.. RTreeQuery queries tree 10NN > res
cat data queries > .t
java -classpath .. Exhaustive .t 10NN > res2
sort -n res > a
sort -n res2 > b
if diff a b
then echo "Same results with exhaustive search. Everything seems fine."
else echo "PROBLEM! We got different results from exhaustive search!"
fi
rm -rf a b res res2 .t tree.*
